package com.example.springactiviti.vo;

import lombok.Data;

@Data
public class Res<T> {
    private int code;
    private String message;

    private T data;

    public static Res success(Object data){
        Res res = new Res<>();
        res.data=data;
        res.code=200;
        return res;
    }
    public static Res success(){
        Res res = new Res<>();
        res.code=200;
        return res;
    }

    public Res fail(String message){
        Res res = new Res<>();
        res.message=message;
        res.code=500;
        return res;
    }
}
